<%@page contentType="text/html" pageEncoding="UTF-8" import="consultas.funciones"%>
<jsp:useBean id="reg" class="consultas.funciones" scope="session" />

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>www.queterifas.com</title>
        <link rel="stylesheet" type="text/css" href="css/estilo.css" media="screen" />
    </head>
    <body>
<header>
            <h1>LOGO</h1>
            <a>en</a>-<a>eus</a><br>
            
            <% if(reg.getUsuario().equals("")){%>
            <form method="post" action="control.jsp">
                <input type="text" name="username" placeholder="Usuario" required />
                <input type="password" name="password" placeholder="Password" required />
                <button type="submit" name="logear" >Acceder</button>
                
                <% if(!reg.usuarioconectadoOK){%> 
                        <p>Datos incorrectos!</p> 
                        <% } %>
                
            </form>
                        <a href='control.jsp?action=registrarse'><button>Registrarse</button></a>
            
            <%}else{%>
            <a href='control.jsp?accion=salir'><button id="btn_out">Sign out!</button></a>
            <span>Hi! <%=reg.getUsuario()%></span>
            <%}%>
            
           
            <div class="limpiador"></div>
</header>
</body>
</html>